package cn.itsource.controller.upload;

import cn.itsource.result.JSONResult;
import cn.itsource.service.IUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class CosUploadController {

    @Autowired
    private IUploadService uploadService;

    @PostMapping("/upload/cos")
    public JSONResult uploadCos(MultipartFile file, String folder){
        String fileUrl = uploadService.uploadCos(file,folder);
        return JSONResult.success(fileUrl);
    }
}
